<style lang="scss" scoped>
@import "@/assets/css/index";
.introduce {
  // @include pageBottom();
  padding: 12px;
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100%;
  background-color: white;
  min-height: 100%;
  font-size: 1.2rem;
  overflow: auto;
  box-sizing: border-box;
  .title {
    width: 100%;
    height: 4rem;
    text-align: center;
    line-height: 4rem;
    font-size: 15px;
    background-color: #fefbf6;
  }
  .panle {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    .panle_item {
      display: flex;
      margin-top: 12px;
      width: 48%;
      padding: 3.3rem 0;
      border-radius: 8px;
      background-color: #fefbf6;
      .imgs {
        border-radius: 8px;
        overflow: hidden;
        margin: 0 10px;
        width: 3rem;
        height: 3rem;
        img {
          width: 100%;
          height: 100%;
        }
      }
      .pan_right {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        :nth-child(1) {
          font-weight: 600;
        }
        :nth-child(2) {
          display: inline-block;
          border-radius: 5px;
          width: 3.5rem;
          padding: 2px 2px;
          text-align: center;
          background: #faca36;
        }
      }
    }
  }
  .mask {
      position: absolute;
      left: 0;
      top: 0;
      right: 0;
      bottom: 0;
      background: rgba(0, 0, 0, .7);
      z-index: 1;
      .iconContainer {
        position: absolute;
        left: 0;
        top: 0;
        right: 0;
        bottom: 0;
        padding: 20px;
        .lockDuck {
          // margin-left: 50%;
          // margin-top: 50%;
          // transform: translate3d(-50%, -50%, 0);
          color: rgba(255, 255, 255);
          font-size: 45px;
          float: right;
          margin-top: 25px;
        }
      }
    }
}
</style>

<template>
  <div class="introduce padding-all-l">
    <!-- <BarNav :is_status="'1'"></BarNav> -->
    <div class="title">客流裂变系统</div>
    <div class="panle">
      <div class="panle_item" v-for="item in modelList" :key="item.id" @click="panleClick(item)">
        <div class="imgs">
          <img :src="item.image" alt="" />
        </div>
        <div class="pan_right" >
          <span>{{ item.name }}</span>
          <span>创建</span>
        </div>
      </div>
    </div>
    <div class="tabbar-height" style="backgroundColor: #fff"></div>

    <!-- <div class="mask">
      <div class="iconContainer">
        <van-icon name="lock" />
      </div>
    </div> -->
  </div>
</template> 
<script>
// import VueUeditorWrap from 'vue-ueditor-wrap';
import { Checkbox, CheckboxGroup, Toast, Icon, Dialog } from "vant";
import { myMixins } from "@/assets/js/mixins.js";
import BarNav from "@/components/BarNav";
//注册子组件
export default {
  name: "ProtocolText",
  mixins: [myMixins],
  components: {
    [Checkbox.name]: Checkbox,
    [CheckboxGroup.name]: CheckboxGroup,
    [Toast.name]: Toast,
    [Icon.name]: Icon,
	[Dialog.name]: Dialog,
    BarNav,
  },
  computed: {},
  data() {
    return {
      checked: false,
      modelList: [],
      openid: '',
      userInfo: {}
    };
  },
  created() {
    this.getCasesModels();
    // this.openid = localStorage.getItem("COPENID")
    if (process.env.NODE_ENV == "production") {
      //线上环境
      this.openid = localStorage.getItem("OPENID") || "没获取到";
    } else {
      this.openid = this.$store.state.openid || localStorage.getItem("OPENID");
    }
    if (
      this.openid == "undefined" ||
      !this.openid ||
      this.openid == undefined
    ) {
      window.location.href = `//${location.hostname}${
        location.href.indexOf("addons") > -1
          ? "/addons/youmi_activitys/public"
          : ""
      }/mobile/index.html`;
      return;
    }
  },
  methods: {
    getCasesModels() {
      const list = []
      this.$request.getCasesModels().then((res) => {
        res.data.forEach(item => {
          if(item.status == 2) return
          list.push(item)
        })
        this.modelList = list
        // this.modelList = res.data;
      });
    },
    panleClick(item) {
		if(item.status == 2) return Toast('请联系平台,去解锁该功能')
		this.$router.push(`/models?model=${item.folder}`)
    }
  },
};
</script>